package com.sop.model;
// Generated 2016-12-19 13:00:56 by Hibernate Tools 4.0.0

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.ForeignKey;
import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * WatchArrangements generated by hbm2java
 */
@Entity
@Table(name = "watch_arrangements", catalog = "sop")
public class WatchArrangements  implements java.io.Serializable {

	private int id;
	private Integer role;
	private PeopleInfo person;
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	private Date time;
	private String normal;
	private String early;
	private String evening;
	private String  replaceMan;

	public WatchArrangements() {
	}

	public WatchArrangements(int id) {
		this.id = id;
	}

	public WatchArrangements(int id, Integer role, Integer person, Date time,
			String normal, String early, String evening) {
		this.id = id;
		this.role = role;
		this.person=new PeopleInfo();
		this.person.setId(person);
		this.time = time;
		this.normal = normal;
		this.early = early;
		this.evening = evening;
	}

	@Id
	@Column(name = "id", unique = true, nullable = false)
	@GeneratedValue(strategy = GenerationType.AUTO)
	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@Column(name = "role")
	public Integer getRole() {
		return this.role;
	}

	public void setRole(Integer role) {
		this.role = role;
	}

	@ManyToOne
    @JoinColumn(name="person")
	@ForeignKey(name="null")
	public PeopleInfo getPerson() {
		return person;
	}

	public void setPerson(PeopleInfo person) {
		this.person = person;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "time", length = 19)
	@JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
	public Date getTime() {
		return this.time;
	}



	public void setTime(Date time) {
		this.time = time;
	}

	@Column(name = "normal", length = 100)
	public String getNormal() {
		return this.normal;
	}

	public void setNormal(String normal) {
		this.normal = normal;
	}

	@Column(name = "early", length = 100)
	public String getEarly() {
		return this.early;
	}

	public void setEarly(String early) {
		this.early = early;
	}

	@Column(name = "evening", length = 100)
	public String getEvening() {
		return this.evening;
	}

	public void setEvening(String evening) {
		this.evening = evening;
	}

	@Column(name = "replaceMan", length = 100)
	public String getReplaceMan() {
		return replaceMan;
	}

	public void setReplaceMan(String replaceMan) {
		this.replaceMan = replaceMan;
	}


}
